package com.muyi.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyi.mapper.CommentMapper;
import com.muyi.pojo.entity.Comment;
import com.muyi.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author VRMMO
* @description 针对表【comment】的数据库操作Service实现
* @createDate 2025-06-11 15:04:41
*/
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment>
    implements CommentService{
    @Autowired
    private CommentMapper commentMapper;

    @Override
    public List<Comment> list() {
        return commentMapper.list();
    }

    @Override
    public void delete(Integer id) {
        commentMapper.deleteById(id);
    }

    @Override
    public void add(Comment comment) {
        commentMapper.insertAll(comment);
    }

    @Override
    public void update(Comment comment) {
        commentMapper.update(comment);
    }

    @Override
    public Comment getByCommentId(Integer id) {
        return commentMapper.getByCommentId(id);
    }


}




